import common from '@/api/common'

const paths = {
  // 1.获取智能工具
  getToolsByUser: '/homePage/tools/getToolsByUser',
  // 2.获取工具列表
  getHomePageToolsList: '/homePage/tools/getHomePageToolsList',
  // 保存已勾选工具
  setHomePageToolsList: '/homePage/tools/setHomePageTools',
  // 获取首页通知公告
  getHomePageNoticeList: '/homePage/notice/getNoticeList',
  // 获取通知公告信息
  getHomePageNoticeDetail: '/homePage/notice/getNoticeDetail',
  // 保存通知公告信息
  saveNoticeInfo: '/homePage/notice/saveNoticeInfo',
  // 删除通知公告信息
  deleteNoticeInfo: '/homePage/notice/deleteNoticeInfo',
  // 设置公告已阅
  setNoticeState: '/homePage/notice/setNoticeState'
}

const homePageService = {};

(function (service) {
  service.getHomePageNoticeList = function (params) {
    return common.post(paths.getHomePageNoticeList, params)
  }
  service.getHomePageNoticeDetail = function (params) {
    return common.post(paths.getHomePageNoticeDetail, params)
  }
  service.saveNoticeInfo = function (data) {
    return common.post(paths.saveNoticeInfo, null, data)
  }
  service.deleteNoticeInfo = function (data) {
    return common.post(paths.deleteNoticeInfo, null, data)
  }
  service.setNoticeState = function (params) {
    return common.post(paths.setNoticeState, params)
  }
  service.getToolsByUser = function (params) {
    return common.post(paths.getToolsByUser, params)
  }
  service.getHomePageToolsList = function (params) {
    return common.post(paths.getHomePageToolsList, params)
  }
  service.setHomePageToolsList = function (params, data) {
    return common.post(paths.setHomePageToolsList, params, data)
  }
})(homePageService)
export default homePageService
